<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Input focus</title>
<meta http-equiv="Content-Type" Content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../../styles/styles.css">
<script language="javascript" src='../links.js' type="text/javascript"></script>
</head>
<body>

<h1>Input focus</h1>
<div class=navbar>
<a href="../index.html">main</a> |
<a href="index.html">Dialog API</a> |
<a href="controls/index.html">Dialog items</a>
</div>

<div class=shortdescr>
<p>For keyboard messages distribution the so-called keyboard input focus conception is used.
Input focus is an attribute which applies to a dialog element. If the element has the focus it
means that it receives all (nearly :)) keyboard messages from FAR Manager system queue.
</p>

<p>The Dialog Manager can move input focus from one element to another. When you press Tab,
Shift-Tab, or Alt-Symbol, the input focus moves to the next/previous dialog element, or to the
element that have the corresponding hot-key defined, respectively.

<p>The dialog callback function can track getting/losing the input focus of dialog controls. When
an element gets the input focus, the callback function receives the
<a href="dmsg/dn_gotfocus.html">DN_GOTFOCUS</a> event. When an element loses the input focus, the
callback function receives the <a href="dmsg/dn_killfocus.html">DN_KILLFOCUS</a> event. In responce
to the <a href="dmsg/dn_killfocus.html">DN_KILLFOCUS</a> event the callback function can disallow
focus loss by the element, by returning the value -1.
The <a href="dmsg/dn_gotfocus.html">DN_GOTFOCUS</a> event has only an
informative meaning, i.e. you can't undo/prevent this event from happening.
</p>

<p>
FAR Manager Dialog API programming interface contains two messages which allow to get or change the
control having the input focus. These messages are <a href="dmsg/dm_getfocus.html">DM_GETFOCUS</a>
and <a href="dmsg/dm_setfocus.html">DM_SETFOCUS</a> correspondingly.

<p>
Listed below are dialog controls which can receive keyboard input focus (provided that there're no
<a href="flags/dif_nofocus.html">DIF_NOFOCUS</a> and/or
<a href="flags/dif_disable.html">DIF_DISABLE</a> flags set for them):
</p>
</div>

<table class="cont">
<tr class="cont"><th class="cont" width="40%">Item</th><th class="cont" width="60%">Description</th></tr>

<tr class="cont"><td class="cont" width="40%"><a href="controls/di_button.html">DI_BUTTON</a></td>
<td class="cont" width="60%">Button.</td></tr>

<tr class="cont"><td class="cont" width="40%"><a href="controls/di_checkbox.html">DI_CHECKBOX</a></td>
<td class="cont" width="60%">Check Box.</td></tr>

<tr class="cont"><td class="cont" width="40%"><a href="controls/di_combobox.html">DI_COMBOBOX</a></td>
<td class="cont" width="60%">Dropdown List (ComboBox).</td></tr>

<tr class="cont"><td class="cont" width="40%"><a href="controls/di_edit.html">DI_EDIT</a></td>
<td class="cont" width="60%">Edit Box.</td></tr>

<tr class="cont"><td class="cont" width="40%"><a href="controls/di_fixedit.html">DI_FIXEDIT</a></td>
<td class="cont" width="60%">Fixed-size Edit Box.</td></tr>

<tr class="cont"><td class="cont" width="40%"><a href="controls/di_listbox.html">DI_LISTBOX</a></td>
<td class="cont" width="60%">List Box.</td></tr>

<tr class="cont"><td class="cont" width="40%"><a href="controls/di_pswedit.html">DI_PSWEDIT</a></td>
<td class="cont" width="60%">Password Input Box.</td></tr>

<tr class="cont"><td class="cont" width="40%"><a href="controls/di_radiobutton.html">DI_RADIOBUTTON</a></td>
<td class="cont" width="60%">Radio Button.</td></tr>

<tr class="cont"><td class="cont" width="40%"><a href="controls/di_usercontrol.html">DI_USERCONTROL</a></td>
<td class="cont" width="60%">Custom control element defined by a programmer.</td></tr>
</table>


<div class=see>See also:</div><div class=seecont>
<a href="defdlgproc.html">DefDlgProc</a>,
<a href="dialogex.html">DialogEx</a>,
<a href="senddlgmessage.html">SendDlgMessage</a>
</div>

</body>
</html>
